package Interpreter;

public class AndExpression implements Expression{
    /*
        构造函数 需要两个 Expression 类型, 因此可以传入 子类型,如 terminalExpression
     */

    private Expression expr1;
    private Expression expr2;

    public AndExpression(Expression ex1, Expression ex2){
        this.expr1 = ex1;
        this.expr2 = ex2;
    }

    @Override
    public boolean interpret(String context) {
        return expr1.interpret(context) && expr2.interpret(context);
    }
}
